public class GirlFriend {
    private int age;
    private String name;
    private String gender;

    public void setAge(int a) {
        if(a>=18&&a<=50){
            age=a;
        }else {
            System.out.println("数据错误");
        }
    }

    public int getAge() {
        return age;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }



}
